//package com.llb666.shop.user.infracore.shadingrule;
//
//import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
//import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
//import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;
//
//
//import java.util.ArrayList;
//import java.util.Collection;
//import java.util.List;
//
///**
// * @author llb666
// * @version 1.0
// */
//public class UUIDShardingRule implements PreciseShardingAlgorithm<String> {
//
//    /**
//     * @param collection 数据分库策略
//     * @param preciseShardingValue 分片规则的字段
//     * @return String
//     */
//    @Override
//    public String doSharding(Collection<String> collection, PreciseShardingValue<String> preciseShardingValue) {
//        String id = preciseShardingValue.getValue(); //id
//        int mod = Math.abs(id.hashCode()%collection.size()) ;
//        List<String> collect = new ArrayList<>(collection);
//        return collect.get(Math.toIntExact(mod));
//    }
//
//}
